import 'package:flutter_test/flutter_test.dart';
import 'package:mr_camera/model/UserDetail.dart';
import 'package:mr_camera/mr_camera.dart';
import 'package:mr_camera/mr_camera_platform_interface.dart';
import 'package:mr_camera/mr_camera_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockMrCameraPlatform
    with MockPlatformInterfaceMixin
    implements MrCameraPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<int> getIpCamCount() {
    // TODO: implement getIpCamCount
    throw UnimplementedError();
  }

  @override
  Future<String> startClientActivity(UserDetail userDetail, String snapshotFilePath) {
    // TODO: implement startClientActivity
    throw UnimplementedError();
  }

  @override
  Future<void> startScanService() {
    // TODO: implement startScanService
    throw UnimplementedError();
  }

  @override
  Future<void> stopScanService() {
    // TODO: implement stopScanService
    throw UnimplementedError();
  }

  @override
  Future<bool> isScanServiceRunning() {
    // TODO: implement isScanServiceRunning
    throw UnimplementedError();
  }

  @override
  Future<void> rediscoverCameras() {
    // TODO: implement rediscoverCameras
    throw UnimplementedError();
  }
}

void main() {
  final MrCameraPlatform initialPlatform = MrCameraPlatform.instance;

  test('$MethodChannelMrCamera is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelMrCamera>());
  });

  test('getPlatformVersion', () async {
    MrCamera mrCameraPlugin = MrCamera();
    MockMrCameraPlatform fakePlatform = MockMrCameraPlatform();
    MrCameraPlatform.instance = fakePlatform;

    expect(await mrCameraPlugin.getPlatformVersion(), '42');
  });
}
